package org.smart4j.framework.utils;

import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.MapUtils;

import java.util.Collection;
import java.util.Map;

/**
 * 集合工具类
 *
 * @author LG93
 * @create 2017-08-10 16:54
 **/
public class CollectionUtil {

	/**
	 * 判断集合是null
	 * @param collection
	 * @return
	 */
	public static boolean isEmpty(Collection collection) {
		return CollectionUtils.isEmpty(collection);
	}

	/**
	 * 判断集合不为null
	 * @param collection
	 * @return
	 */
	public static boolean isNotEmpty(Collection collection) {
		return CollectionUtils.isNotEmpty(collection);
	}

	/**
	 * 判读map是否为null
	 * @param map
	 * @return
	 */
	public static boolean isEmpty(Map<?, ?> map) {
		return MapUtils.isEmpty(map);
	}

	/**
	 * 判读map是否非null
	 * @param map
	 * @return
	 */
	public static boolean isNotEmpty(Map<?, ?> map) {
		return MapUtils.isNotEmpty(map);
	}




}
